<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2017 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 老猫 <thinkcmf@126.com>
// +----------------------------------------------------------------------
namespace app\portal\controller;

use app\portal\model\PortalCategoryModel;
use app\portal\model\PortalPostModel;
use cmf\controller\HomeBaseController;

class IndexController extends HomeBaseController
{
    public function index()
    {
        $model=new PortalCategoryModel();
        $data=$model->where(['delete_time'=>0,'parent_id'=>0])->select()->toArray();
        $this->assign('data',$data);

        return $this->fetch(':index');
    }
    public function article()
    {
        $cate_id=$this->request->param('cate_id');
        $model=new PortalPostModel();
        $article=$model->where(['delete_time'=>0,'parent_id'=>'id'])->select()->toArray();
        $this->assign('article',$article);
        return $this->fetch();
    }
}
